# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BigQuery.V2.Model.JobStatistics3 do
  @moduledoc """
  Statistics for a load job.

  ## Attributes

  *   `badRecords` (*type:* `String.t`, *default:* `nil`) - Output only. The number of bad records encountered. Note that if the job has failed because of more bad records encountered than the maximum allowed in the load job configuration, then this number can be less than the total number of bad records present in the input data.
  *   `inputFileBytes` (*type:* `String.t`, *default:* `nil`) - Output only. Number of bytes of source data in a load job.
  *   `inputFiles` (*type:* `String.t`, *default:* `nil`) - Output only. Number of source files in a load job.
  *   `outputBytes` (*type:* `String.t`, *default:* `nil`) - Output only. Size of the loaded data in bytes. Note that while a load job is in the running state, this value may change.
  *   `outputRows` (*type:* `String.t`, *default:* `nil`) - Output only. Number of rows imported in a load job. Note that while an import job is in the running state, this value may change.
  *   `timeline` (*type:* `list(GoogleApi.BigQuery.V2.Model.QueryTimelineSample.t)`, *default:* `nil`) - Output only. Describes a timeline of job execution.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :badRecords => String.t() | nil,
          :inputFileBytes => String.t() | nil,
          :inputFiles => String.t() | nil,
          :outputBytes => String.t() | nil,
          :outputRows => String.t() | nil,
          :timeline => list(GoogleApi.BigQuery.V2.Model.QueryTimelineSample.t()) | nil
        }

  field(:badRecords)
  field(:inputFileBytes)
  field(:inputFiles)
  field(:outputBytes)
  field(:outputRows)
  field(:timeline, as: GoogleApi.BigQuery.V2.Model.QueryTimelineSample, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.BigQuery.V2.Model.JobStatistics3 do
  def decode(value, options) do
    GoogleApi.BigQuery.V2.Model.JobStatistics3.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BigQuery.V2.Model.JobStatistics3 do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
